#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
int N, K;long long ans;
void dfs(int n, int k, int sum);
int main()
{
	cin >> N >> K;
	dfs(1, 0, 0);
	cout << ans;
	return 0;
}
void dfs(int n, int k, int sum)
{   
	//if (N - sum < n && k != K)return;
	if (k == K) { if (sum == N) ans++; return; }
	//if (n > N / 2)return;
	for (int i = n; sum + i * (K - k) <= N; i++) {
		dfs(i, k + 1, sum + i);
	}
}
